package org.example.t0601;

/**
 * 插入排序
 */
public class InsertSort {
    static volatile  int [] array = new int[]{34,56,12,89,33,67};
    public static void main(String[] args) {

        for(int i =0 ; i < array.length ; i ++ ){
            for(int j = i ; j > 0 && array[j-1] > array[j];j--){
                int tmp = array[j];
                array[j] = array[j-1];
                array[j-1] = tmp;
            }
        }
        for(int i =0 ; i < array.length ; i ++ ){
            System.out.print(array[i] + " ");
        }

    }
}
